package ray.mgocc.title;

public class Chicken extends WeekTitle{
    public String getName(){ return "CHICKEN";}
    public int getPriority(){ return 13;}
    public int getPlayTimeThreshold(){ return 3;}
    public void init(){
        super.init();
        add(new ChikenRequirement());
    }
    class ChikenRequirement extends Requirement{
        public String getName(){ return "chiken"; }
        public double getChikenRatio(){
            String key = "Total.";
            int round = getValue(key+"ROUND");
            key += "ALL.";
            int interference =
                getValue(key+"KILLS")
                + getValue(key+"DEATHS")
                + getValue(key+"STUNS")
                + getValue(key+"STUNS RECIEVED");
            return ((double)interference)/round;
        }
        public double getThreshold(){
            return 0.5;
        }
        public double getRatio(){
            double ratio;
            double numerator = getThreshold();
            double denominator = getChikenRatio();
            if(0==denominator){
                ratio = 0;
            }else{
                ratio = numerator/denominator;
            }
            return ratio;
        }
        public String toString(){
            return super.toString()+"("+getThreshold()+">"+format(getChikenRatio())+")";
        }
    }
}

